package EvaTCPL;
import java.lang.Math;

public class EvaTCPLthis extends EvaTCPLaexpression
{
  EvaTCPLVariable var;
  int timestep;
  String identifier;

  public EvaTCPLthis(int thetimestep)
    {
      super();
      timestep = thetimestep;
    }

  /** Evaluate this arithmetic expression. */
  public double evaluate()
    { 
      return var.getIStoreRealValue(timestep);
    }

  public void initialize_inner(EvaTCPLProblem theproblem)
    {
      identifier = theproblem.init_curvarname;
      var = theproblem.findVariable(identifier);
    }

  public String toString()
    {
      return "this["+timestep+"]";
    }

}
